package worldinruin.core;

import java.awt.Color;
import java.beans.PropertyChangeListener;
import java.util.List;


public interface IPlayer {

	/**
	 * Gets the players name.
	 * @return A name in a string.
	 */
	String getName();

	/**
	 * Gets the players color.
	 * @return Players color.
	 */
	Color getColor();

	/**
	 * Gets the players current resources.
	 * @return Resources the players has.
	 */
	IResources getResources();

	/**
	 * Gets all the buildings the player owns.
	 * @return List of buildings.
	 */
	List<IBuilding> getBuildings();

	/**
	 * Adds a building to player.
	 * @param building Building added to players list of buildings.
	 */
	void addBuilding(IBuilding building);

	/**
	 * Removes a building from the player.
	 * @param building Building that is subject to be removed from list.
	 */
	void removeBuilding(IBuilding building);

	/**
	 * Checks if the player can afford a purchase.
	 * @param r Cost of the purchase.
	 * @return True if player has enough resources, false if player doesn't.
	 */
	boolean canAfford(IResources r);

	/**
	 * Adds resources to player.
	 * @param r Amount of resources to add.
	 */
	void addToResources(IResources r);

	/**
	 * Subtracts resources from player.
	 * @param price Amount of resources to subtract.
	 */
	void subtractFromResources(IResources price);

	/**
	 * Adds a propertychangelistener.
	 * @param l A propertychangelistener.
	 */
	void addPropertyChangeListener(PropertyChangeListener l);

	/**
	 * Removes a propertychangelistener.
	 * @param l A propertychangelistener.
	 */
	void removePropertyChangeListener(PropertyChangeListener l);

}